<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>窗口大小与位置</title>
	</head>
	<body>
		<p>
			<input type="button" value="打开窗口" onclick="openWin()" />
		</p>
		<p>
			<input type="button" value="调整窗口大小和位置" onclick="changeWin()"/>
		</p>
		<script>
			var mywin;
			function getWinMessage(){
				mywin.document.write("相对于屏幕窗口的坐标："+mywin.screenX+','+mywin.screenY+'<br>');
				mywin.document.write("窗口文档的高度和宽度："+mywin.innerWidth+','+mywin.innerHeight+'<br>');
				mywin.document.write("窗口外部的高度和宽度："+mywin.outerWidth+','+mywin.outerHeight+'<br>');
			}
			function openWin(){
				mywin=open('','我的新窗口','width=250,height=300');
				getWinMessage();
			}
			function changeWin(){
				mywin.moveBy(250,250);
				mywin.resizeTo(500,350);
				getWinMessage();
			}
		</script>
	</body>
</html>
